package com.niiwoo.civet.account.service.bankcard;

import com.niiwoo.civet.account.dto.common.BankCardDTO;
import com.niiwoo.civet.account.dto.common.BankCardRebindOrderDTO;
import com.niiwoo.civet.account.dto.common.BankTypeDTO;
import com.niiwoo.civet.account.dto.common.PayChannelDTO;
import com.niiwoo.civet.account.dto.common.sendmessage.SendMessageDTO;
import com.niiwoo.civet.account.dto.request.*;
import com.niiwoo.civet.account.dto.response.*;

import java.util.List;

/**
 * 银行卡相关服务类
 * Created by wangjichao on 2017/11/8.
 */
public interface BankCardDubboService {

    /**
     * 获取系统支持的银行类型
     * @return
     */
    List<BankTypeDTO> getSupportBankTypeList();

    /**
     * 根据卡号前缀查询对应的银行类型（卡bin接口）
     * @return
     */
    BankTypeDTO getBankTypeByCardBinNo(String cardBinNo);

    /**
     * 通过id查询银行卡信息
     * @param id
     * @return
     */
    BankCardDTO getBankCardInfoById(Long id);

    /**
     * 获取普通用户银行卡信息
     * @param userId
     * @return
     */
    GetSimpleUserBankCardResponse getSimpleUserBankCard(String userId);

    /**
     * 获取普通用户银行卡信息
     * @param userId
     * @param orgId 机构ID
     * @return
     */
    default GetSimpleUserBankCardResponse getSimpleUserBankCard(String userId,String orgId){return null;}

    /**
     * 换绑银行卡前置校验
     * @param orgId
     * @return
     */
    RebindBankCardCheckResponse rebindBankCardCheck(String orgId);

    /**
     * 换绑银行卡前置校验
     *
     * @param userId
     * @param orgId
     * @return
     */
    default RebindBankCardCheckResponse rebindBankCardCheck(String userId,String orgId){return null;}

    /**
     * 初始化换绑卡订单
     * @return
     */
    BankCardRebindOrderDTO initBankCardRebindOrder(InitBankCardRebindOrderRequestDTO requestDTO);

    /**
     * 获取集团帐户当前银行卡信息
     * @param userId
     * @return
     */
    BankCardDTO getUserBankCardInfo(String userId);


    /**
     * 根据帐户ID获取非集团帐户银行卡
     * @param accountId
     * @return
     */
    default BankCardDTO getUserBankCardByAccountId(Long accountId) {
        return null;
    }

    /**
     * 银行卡换绑成功回调
     * @param request
     * @return
     */
    BankCardRebindCallbackResponseDTO bankCardRebindCallback(BankCardRebindCallbackRequestDTO request);

    /**
     * 企业换绑银行卡回调
     * @param request
     * @return
     */
    default CompanyBankCardRebindCallbackResponseDTO companyBankCardRebindCallback(CompanyBankCardRebindCallbackRequestDTO request){return null;}

    /**
     * 获取用户的充值通道
     * @param bankTypeId
     * @param userId
     * @return
     */
    PayChannelDTO getUserRechargeChannelByRoute(Long bankTypeId,String userId);

    /**
     * 换绑卡补单JOB
     */
    void rebindBankCardJob();

    /**
     * 通过存管修改预留手机号后回调更新
     * @return
     */
    boolean updateBankCardMobileNo(UpdateBankCardMobileNoRequestDTO requestDTO);

    /**
     * 发送换绑审核通过消息
     *
     * @param sendMessageDTO dto
     */
    void sendMsgForChangeBankCardAduitPassed(SendMessageDTO sendMessageDTO);

    /**
     * 发送换绑审核通过消息
     *
     * @param sendMessageDTO dto
     * @param params params
     */
    void sendMsgForChangeBankCardAduitNotPassed(SendMessageDTO sendMessageDTO, List<Object> params);

    /**
     * 极速借机构用户银行卡是否一致
     *
     * @param orgId
     * @param userId
     * @param bankCard
     * @return
     */
    default boolean orgUserBankCardIsMatch(String orgId, String userId, String bankCard) {
        return false;
    }

    /**
     * 企业借款人银行卡信息是否一致
     *
     * @param orgId
     * @param companyOrgId
     * @param bankCard
     * @return
     */
    default boolean orgCompanyBankCardIsMatch(String orgId, String companyOrgId, String bankCard) {
        return false;
    }

    /**
     * 获取系统支持的银行类型(PC端)
     * @return
     */
    default List<BankTypeDTO> getSupportBankTypeListByPC(){return null; };

    /**
     * 解绑银行卡
     * @param unbindCompanyBankCardRequestDTO
     * @return
     */
    default void unbindCompanyBankCard(UnbindCompanyBankCardRequestDTO unbindCompanyBankCardRequestDTO){}

    /**
     * 解绑银行卡回调成功
     *
     * @param unbindCompanyBankCardCallbackRequestDTO
     * @return
     */
    default UnbindBankCardCallbackResponseDTO unbindCompanyBankCardCallbackSuccess(UnbindCompanyBankCardCallbackRequestDTO unbindCompanyBankCardCallbackRequestDTO) {
        return null;
    }

    /**
     * 解绑银行卡回调失败
     *
     * @param unbindCompanyBankCardCallbackRequestDTO
     * @return
     */
    default UnbindBankCardCallbackResponseDTO unbindCompanyBankCardCallbackFailed(UnbindCompanyBankCardCallbackRequestDTO unbindCompanyBankCardCallbackRequestDTO) {
        return null;
    }

    /**
     * 企业换绑银行卡
     * @param rebindCompanyBankCardRequestDTO
     * @return
     */
    default RebindCompanyBankCardResponseDTO rebindCompanyBankCard(RebindCompanyBankCardRequestDTO rebindCompanyBankCardRequestDTO){return null;}

    /**
     * 是否有换绑中的订单
     * @param accountId
     * @return
     */
    default Boolean haveRebindingOrderForOrg(Long accountId){return false;}

}
